// Prevent console window in addition to Slint window in Windows release builds when, e.g., starting the app via file manager. Ignored on other platforms.
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use std::error::Error;

slint::include_modules!();

fn main() -> Result<(), Box<dyn Error>> {
    let ui = AppWindow::new()?;

    ui.on_login(move |username, password| {
        println!("username: {username}, password: {password}");
        if username == "1" && password == "2" {
            true
        } else {
            false
        }
    });

    ui.run()?;

    Ok(())
}
